home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d21 / dvglue10.arc / DVMEM.C < prev    next >
C/C++ Source or Header  |  1988-08-13  |  2KB  |  66 lines

  1. /*=======================================================*/
  2. /*  DVMEM.C                                              */
  3. /*     functions to find out how much memory is avail    */
  4. /*                                                       */
  5. /*  (c) Copyright 1988 Ralf Brown  All Rights Reserved   */
  6. /*  May be freely copied for noncommercial use, so long  */
  7. /*  as this copyright notice remains intact, and any     */
  8. /*  changes are marked in the comment blocks preceding   */
  9. /*  functions.                                           */
  10. /*=======================================================*/
  11.  
  12. #include "tvapi.h"
  13.  
  14. /*======================================================*/
  15. /* DVcommon_mem--get amount of common memory in bytes   */
  16. /*   Ralf Brown 4/3/88                                  */
  17. /*======================================================*/
  18.  
  19. void pascal DVcommon_mem(WORD *avail, WORD *largest, WORD *total)
  20. {
  21.    WORD av ;
  22.  
  23.    _AX = 0xDE04 ;
  24.    geninterrupt(0x15) ;
  25.    av = _BX ;   /* _BX will be destroyed in dereferencing pointers */
  26.    *largest = _CX ;
  27.    *total = _DX ;
  28.    *avail = av ;
  29. }
  30.  
  31. /*======================================================*/
  32. /* DVconv_mem--get amount of conventional memory in K   */
  33. /*   Ralf Brown 4/3/88                                  */
  34. /*======================================================*/
  35.  
  36. void pascal DVconv_mem(WORD *avail, WORD *largest, WORD *total)
  37. {
  38.    WORD av ;
  39.  
  40.    _AX = 0xDE05 ;
  41.    geninterrupt(0x15) ;
  42.    av = _BX ;   /* _BX will be destroyed in dereferencing pointers */
  43.    *largest = _CX ;
  44.    *total = _DX ;
  45.    *avail = av ;
  46. }
  47.  
  48. /*======================================================*/
  49. /* DVexp_mem--get amount of expanded memory in K        */
  50. /*   Ralf Brown 4/3/88                                  */
  51. /*======================================================*/
  52.  
  53. void pascal DVexp_mem(WORD *avail, WORD *largest, WORD *total)
  54. {
  55.    WORD av ;
  56.  
  57.    _AX = 0xDE06 ;
  58.    geninterrupt(0x15) ;
  59.    av = _BX ;   /* _BX will be destroyed in dereferencing pointers */
  60.    *largest = _CX ;
  61.    *total = _DX ;
  62.    *avail = av ;
  63. }
  64.  
  65. /* End of DVMEM.C */
  66.